package cn.edu.tsinghua.cic.ccss.dto;

import java.util.Arrays;

import org.forten.core.dto.GeneralDto;

public class CoursewareDto implements GeneralDto{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1850554970393931427L;
	
	private Long id;
	private Long courseId;
	private String wareName;
	private byte[] courseware;
	private String bz;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Long getCourseId() {
		return courseId;
	}
	public void setCourseId(Long courseId) {
		this.courseId = courseId;
	}
	public String getWareName() {
		return wareName;
	}
	public void setWareName(String wareName) {
		this.wareName = wareName;
	}
	public byte[] getCourseware() {
		return courseware;
	}
	public void setCourseware(byte[] courseware) {
		this.courseware = courseware;
	}
	public String getBz() {
		return bz;
	}
	public void setBz(String bz) {
		this.bz = bz;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((bz == null) ? 0 : bz.hashCode());
		result = prime * result
				+ ((courseId == null) ? 0 : courseId.hashCode());
		result = prime * result + Arrays.hashCode(courseware);
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result
				+ ((wareName == null) ? 0 : wareName.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CoursewareDto other = (CoursewareDto) obj;
		if (bz == null) {
			if (other.bz != null)
				return false;
		} else if (!bz.equals(other.bz))
			return false;
		if (courseId == null) {
			if (other.courseId != null)
				return false;
		} else if (!courseId.equals(other.courseId))
			return false;
		if (!Arrays.equals(courseware, other.courseware))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (wareName == null) {
			if (other.wareName != null)
				return false;
		} else if (!wareName.equals(other.wareName))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "CoursewareDto [id=" + id + ", courseId=" + courseId
				+ ", wareName=" + wareName + ", courseware="
				+ Arrays.toString(courseware) + ", bz=" + bz + "]";
	}
	
}
